<!--{*搜索*}-->
<div class="auto-search fn-clear">
	<form id="auto-search-form" class="fn-left fn-clear" action="{url('auto/search')}">
		<input id="auto-search-ipt" type="text" name="kw" placeholder="输入车型..." value="{if $kw}{$kw}{else}输入车型...{/if}"/>
		<button id="auto-search-btn" type="submit">搜索</button>
	</form>
	<dl class="auto-search-hot fn-right">
		<dt>热门车型：</dt>
		<dd><a href="{url('auto/search', 'kw='.urlencode('乐驰'))}">乐驰</a></dd>
		<dd><a href="{url('auto/search', 'kw='.urlencode('宝马'))}">宝马</a></dd>
	</dl>
</div>
        <script>
            seajs.use(['lm-util'],function(util){
                var $search = $("#auto-search-ipt"),
                        defaultText = $search.attr('placeholder');
                $search.click(function() {
                    if ($.trim($(this).val()) === defaultText) {
                        $(this).val('');
                    }
                }).blur(function() {
                            if ($.trim($(this).val()) === '') {
                                $(this).val(defaultText);
                            }
                        });
                $("#auto-search-form").submit(function(){
                    var searchText = $.trim($search.val());
                    if (searchText === defaultText || searchText === ''){
                        alert("请输入搜索内容。");
                        return false;
                    }
                });
            })
        </script>